/**
 * Class containing the always-cooperate strategy.
 * @author	081028AW
 */
public class StrategySimpleEvolved extends Strategy
   {
  /**
   * Encoding for a strategy.
   */

  // 0 = defect, 1 = cooperate

	double niceness;
	
	
   public StrategySimpleEvolved()
      {
      name = "Simple Evolution";
      niceness = 0.2857;
      myLastMove = 1;
      } 
   
   public StrategySimpleEvolved(double n)
   {
	   name = "Simple Evolution";
	   niceness = n;
	   myLastMove = 1;
   }

   public int nextMove()
      {
	   		
	   		if(myLastMove != opponentLastMove)
	   		{
	   			if (Math.random() < niceness)
	   				return 1;
	   			else 
	   				return 0;
	   		}	
	   		return 1;
      }  
   } 

